package demo1;

interface Shape {
    void draw();
}

abstract class B implements Shape { //没有实现接口中的抽象方法，可以设置为抽象类

}

class Rect implements Shape{
    public void draw() {
        System.out.println("画矩形");
    }
}
class Ellipse implements Shape{
    public void draw() {
        System.out.println("画椭圆");
    }
}
public class Test2 {
    public static void drawTest(Shape shape) {
        shape.draw();
    }

    public static void main(String[] args) {
        drawTest(new Rect());
        drawTest(new Ellipse());
    }

}
